<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
function ouputcsv()
{
	$("#if_csv").val(1);
	$("#search").submit();
}


</script>
<title>工厂报表</title>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent">
<div class="pageheader notab">
  <h1 class="pagetitle">工厂报表</h1>
  <span class="pagedesc"></span>
  <div class="menulist"> </div>
</div>
<!--pageheader-->
<div id="contentwrapper" class="contentwrapper">
  <div id="basicform" class="subcontent"> 
    <!--搜索栏-->
    <div>
      <div style="clear: both"></div>
      <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
    </div>
    <form class="stdform stdform2" method="get" id="search" action="/factory/revenue">
      <input type='hidden' name='if_csv' id='if_csv'>
      <div class="tableoptions">
        <select name="fID" id="fID"  class="selection " style="width:100px;" >
          <option value="" >工厂</option>
          
        {{foreach from=$factorylist item=li key=key}}
			
          <option value="{{$li.id}}" {{if $li.id==$fID}} selected{{/if}}>{{$li.name}}</option>
          
        {{/foreach}}
        
        </select>
        &nbsp;
        生产工人:
        <select class="selectCss2" name="wk" id="wk">
          <option value="">请选择</option>
          
        {{foreach from=$workers item=res key=key}}
        
          <option value="{{$res.id}}" {{if $wk==$res.id}} selected{{/if}}> {{$res.name}} </option>
          
        {{/foreach}}
        
        </select>
        &nbsp;
        裁剪:
        <select class="selectCss2" name="cj" id="cj">
          <option value="">请选择</option>
          
            {{foreach from=$caijian item=res key=key}}
            
          <option value="{{$res.id}}" {{if $cj==$res.id}} selected{{/if}}> {{$res.name}} </option>
          
            {{/foreach}}
            
        </select>
        <select name="ty" id="searchtype" class="selection" style="width:100px;" >
          <option value="1" {{if $ty==1}} selected{{/if}}>订单时间</option>
          <option value="4" {{if $ty==4}} selected{{/if}}>完成时间</option>
        </select>
        <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
        -
        <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
        &nbsp;
         订单号: <input type="text" name="other" id="other" class="width200" value="{{$other}}" placeholder="" />
        <button class="btn btn-primary" id="searchbtn">Search</button>
        {{if $managers || in_array('104',$showpower)}}
        <button onClick="ouputcsv()"  class="stdbtn btn_black">订单导出</button>
        {{/if}} </div>
    </form>
    <!--搜索栏结束-->
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable" style="table-layout: fixed;">
      <thead>
        <tr class="lbbt">
          <td bgcolor="#FEFFF1">订单编号</td>
          <td bgcolor="#FEFFF1">完成时间</td>
          <td bgcolor="#FEFFF1">订单时间</td>
          <td bgcolor="#FEFFF1">生产方式</td>
          <td bgcolor="#FEFFF1">商品编号</td>
          
          <td bgcolor="#FEFFF1">商品名称</td>
          <td bgcolor="#FEFFF1">生产工人</td>
          <td bgcolor="#FEFFF1">裁剪人员</td>
          <td bgcolor="#FEFFF1">质检人员</td>
          <td bgcolor="#FEFFF1">工价</td>
          <td bgcolor="#FEFFF1">出厂价</td>
          <td bgcolor="#FEFFF1">工厂</td>
        </tr>
      </thead>
      <tbody >
      
      {{foreach from=$orderlist item=li key=key}}
      <tr>
        <td valign="middle"  style="position:relative;"><a href="/factory/orderdetail?id={{$li.orderId}}"><font color="#6666FF">{{$li.ordernumber}}</font></a></td>
        <td valign="middle" >{{$li.finshtime}}</td>
         <td valign="middle" >{{$li.orderTime}}</td>
         <td valign="middle" >
         {{if $li.custom==1}}均码{{/if}}
         {{if $li.custom==2}}定制{{/if}}
         {{if $li.custom==3}}配件{{/if}}</td>
        <td   style="position:relative;">{{$li.goods_sku}}</td>
        <td valign="middle"  style="width: 50px; overflow:hidden;white-space:nowrap; text-overflow:ellipsis;" >{{$li.skuName}}</td>
        <td valign="middle" >{{$li.resproWorker}}</td>
        <td  class="cz">{{$li.person1}}</td>
        <td  class="cz">{{$li.person3}}</td>
        <td  class="cz">{{$li.price}}</td>
         <td  class="cz">{{$li.g_costprice}}</td>
        <td  class="cz">{{$li.factoryl}}</td>
      </tr>
      {{/foreach}}
      <tr>
        <td colspan="9" valign="middle" align="right" bgcolor="#FFFFFF" style="position:relative;"><span class="cz">合计工价</span></td>
        <td bgcolor="#FFFFFF" class="cz">{{$allprice}}</td>
        <td colspan="2" bgcolor="#FFFFFF" class="cz">成本合计：{{$allmoney}}</td>
      </tr>
        </tbody>
      
    </table>
    <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
  </div>
</div>
</body>
</html>